package com.bjtang.book.entiy;

import java.time.LocalDateTime;

import javax.validation.constraints.Email;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Null;

import org.hibernate.validator.constraints.Length;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Data;

//系统基础信息用户表
@Data
public class SysUser {
	// 主键
	@TableId(type = IdType.AUTO)
	private Long userId;
	// 姓名
	@Length(min = 0, max = 50)
	private String name;
	// 邮箱
	@Email
	@Length(min = 0, max = 100)
	private String email;
	// 手机
	@Length(min = 0, max = 19)
	private String phone;
	// 地址
	@Length(min = 0, max = 500)
	private String userAddress;
	// 登陆名
	@Length(min = 4, max = 64)
	private String loginName;
	// 密码
	@Length(min = 6, max = 128)
	@TableField(select = false) // 查询结果不显示
	private String password;
	// 创建者ID
	@Null
	private Long founder;
	// 创建时间
	@Null
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime creationTime;
	// 更新者Id
	@Null
	private Long updateBy;
	// 更新时间

	@Null
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private LocalDateTime updateTime;
	// 用户状态
	@Max(value = 1)
	@Min(value = 0)
	private Integer status;
	// 删除标志
	// 逻辑删除标识(0.未删除,1.已删除)
	@TableLogic
	@TableField(select = false) // 查询结果不显示
	private Integer deleted;
}
